import axios from "@/request";
import { $m } from "@/MUI";

// 情报源列表
export function sourceList() {
  return axios.get("/source/list");
}

// 更新情报源权重
export function intelligenceSourceSort(data) {
  // {"id": 0, "weight": 0}
  // var url = $m.paramsSplice('/intelligence/source/sort', entKey)
  return axios.patch('/source/sort', {
    items: data
  });
}

// 更新情报源apikey
export function intelligenceSourceApikey(intel_source_id) {
  //
  /*var url = $m.paramsSplice('/source/apikey', {
    apikey: intel_source_id
  })*/
  return axios.patch('/source/apikey/2', {
    apikey: intel_source_id
  });
}

// 情报更新记录
export function intelligenceSourceUpdateRecordList(data) {
  return axios.get("/update_record/list", {
    params: data,
  });
}

// 下载错误报告  '/intelligence/download/fail'
export function intelligenceDownloadFail(data) {
  return axios.get("/custom/download/fail", {
    params: data,
  });
}

// 导入自定义情报源 '/intelligence/upload'
export function intelligenceUpload(data) {
  return axios.post("/custom/upload", data);
}

// 下载excel模板 '/intelligence/download/example'
export function intelligenceDownloadExample() {
  return axios.get("/custom/download/example");
}

// 自定义情报源列表 '/intelligence/custom/list'
export function intelligenceCustomList(data) {
  return axios.get("/custom/list",{
    params: data,
  });
}

// 删除自定义情报源 '/intelligence/custom/:intel_custom_id'
export function intelligenceCustomDelete(intel_custom_id) {
  var url = $m.paramsSplice('/custom', intel_custom_id)
  return axios.delete(url);
}

// 批量删除自定义情报源 '/intelligence/custom/delete'
export function intelligenceCustomBatchDelete(data) {
  return axios.post("/custom/delete", {intel_custom_ids:data});
}

// 自定义情报源列表 '/intelligence/custom/list'
export function intelligenceMockUserLogin(data) {
  return axios.get("/mock/user/login?user_id=1",{
    params: data,
  });
}

export function intelligenceXXX(data) {
  return axios.get("/xxx",{
    params: data,
  });
}

// export function getAuth(data) {
//   return axios.get("/hr/service/menu/getStaffMenus", {
//     params: data,
//   });
// }

// export function getUserInfo() {
//   return axios.get("/hr/staff/queryStaffInfo", {});
// }

// export function getDict(key) {
//   var url = $m.paramsSplice("/system/dict/data/type", key);
//   return axios.get(url);
// }

// export function getEntpriseList() {
//   return axios.get("/hr/staff/entInfoList", {});
// }

// export function setCurrentEnterprise(entKey) {
//   var url = $m.paramsSplice('/hr/staff/updateEntKey', entKey)
//   return axios.put(url);
// }
